<?php
defined('IN_TS') or die('Access Denied.');


$arrMsg = $new['message']->findAll('message',array(
	'touserid'=>$strUser['userid'],
	'isread'=>'0',
));

foreach($arrMsg as $key=>$item){
	$arrMsg[$key]['content'] = tsDecode($item['content']);
	if($item['userid']){
		$arrMsg[$key]['user'] = aac('user')->getOneUser($item['userid']);
		$count_Msg = $new['message']->findCount('message',array(
			'touserid'=>$strUser['userid'],
			'userid'=>$item['userid'],
			'isread'=>'0',
		));
		$arrMsg[$key]['count']=$count_Msg;
		$url=tsUrl('message','user',array('touserid'=>$item['userid']));
	}else{
		$arrMsg[$key]['user']['username']='系统通知';
		$count_Msg = $new['message']->findCount('message',array(
			'touserid'=>$strUser['userid'],
			'userid'=>'0',
			'isread'=>'0',
		));
		$arrMsg[$key]['count']=$count_Msg;
		$arrMsg[$key]['user']['face']='uploadfile/user/0/0/1.png';
		$url=tsUrl('message','system');
	}

}

$title = '我的消息盒子';

include template("my");